package com.dq.repository.user;

import com.dq.domain.sys.user.user.base.SysUser;
import com.dq.domain.sys.user.user.centre.UserSummary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.math.BigDecimal;

/**
 * @Author luchangtong
 * @Date 2020/4/10 14:07
 */
public interface UserSummaryRepository extends JpaRepository<UserSummary, Long> {
    @Query(nativeQuery = true,value = "SELECT count(price) FROM `user_summary`\n" +
            "where create_user_id = ?1 and create_time >= ?2")
    BigDecimal countCompleted(Long wxUserIds, Long time);

    UserSummary findByDeletedFalseAndCreateUserAndYearAndMonthAndDay(SysUser sysUser,Long year,Long month,Long day);
}
